package com.brightfuture.chrms.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;
import java.time.LocalDateTime;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.github.yulichang.annotation.EntityMapping;

import java.util.List;

/**
 * 岗位信息
 *
 * @author victor
 * @date 2024-02-04 22:31:50
 */
@Data
@TableName("position")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "岗位信息")
public class PositionEntity extends Model<PositionEntity> {


    /**
     * 岗位ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "岗位ID")
    private Long positionId;

    /**
     * 部门ID
     */
    @Schema(description = "部门ID")
    private Long deptId;
    /**
     * 岗位名称
     */
    @Schema(description = "岗位名称")
    private String name;

    /**
     * 岗位描述
     */
    @Schema(description = "岗位描述")
    private String dscr;

    /**
     * 岗位数量
     */
    @Schema(description = "岗位数量")
    private Integer total;

    /**
     * 当前状态
     */
    @Schema(description = "当前状态")
    private String state;

    /**
     * 生效日期
     */
    @Schema(description = "生效日期")
    private LocalDate beginDate;

    /**
     * 作废日期
     */
    @Schema(description = "作废日期")
    private LocalDate endDate;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建人")
    private Long createBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新人")
    private Long updateBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 删除标识
     */
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "删除标识")
    private String delFlag;

    /**
     * 租户号
     */
    @Schema(description = "租户号")
    private Long tenantId;
    @ExcelIgnore
    @TableField(exist = false)
    @EntityMapping(thisField = "positionId", joinField = "positionId")
    private List<PositionStandardEntity> positionStandardList;


    /**
     * 部门ID
     */
    @TableField(exist = false)
    @Schema(description = "部门名称")
    private Long deptName;

    /**
     * 时间范围
     */
    @TableField(exist = false)
    @Schema(description = "日期范围")
    private String dateScope;

}